<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import axios from 'axios';
import requestUrl from './serverApi';
export default {
  name: 'App',
  created() {
    //  将初始化数据写入到数据库中，只会在项目初始化时执行一次
    this.getInitData();
  },
  methods: {
    getInitData() {
      axios.get(requestUrl.getAllCategory);
      axios.get(requestUrl.getAllSub);
      axios.get(requestUrl.getAllGoods);
    }
  },
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #2c3e50;
  /* margin-top: 60px; */
  background-color: #f0f0f0;
}
</style>
